﻿using MediatR;
using T.Basic.API.Appliction.Command.CargoOwnerCommand;
using T.Basic.API.Appliction.Command.LineCommand;
using T.Basic.Domain.T.Basic.Model;
using T.Basic.Repository.BasicInterface;

namespace T.Basic.API.Appliction.CommandHandlers.CargoOwnerHanders
{
    /// <summary>
    /// 反填货主信息
    /// </summary>
    public class CargoOwnerGetByIdCommandHandler : IRequestHandler<CargoOwnerGetByIdCommand, CargoOwner>
    {
        private readonly ICargoOwnerRepository _CargoOwnerrepository;
        public CargoOwnerGetByIdCommandHandler(ICargoOwnerRepository cargoOwnerrepository)
        {
            _CargoOwnerrepository = cargoOwnerrepository;
        }

        public async Task<CargoOwner> Handle(CargoOwnerGetByIdCommand request, CancellationToken cancellationToken)
        {
            return await _CargoOwnerrepository.GetModelsAsync(request.CargoOwnerId);
        }
    }
}
